class Box < ActiveRecord::Base
  attr_accessible :description, :price, :title, :product_url, :dimensions, :format
  acts_as_heir_of :product

  validates :description, :price, :title, :product_url, :dimensions, :format, presence: true
  validates :price, numericality: {greater_than_or_equal_to: 0.01}
  #validates :title, uniqueness: true  ---> En la clase padre
  # regex para dimensions
  validates :dimensions, :format => {:with => /^([0-9]+[x])([0-9]+[x])([0-9]+)$/}
end
